package com.mango.http.action;

import java.util.Map;

import com.google.common.collect.Maps;
import com.mango.http.DataSet;
import com.mango.http.ParaSet;
import com.mango.http.R;
import com.mango.http.ReqKey;

@ReqKey("/")
public class IndexAction {
	//跳转页面
	public DataSet index(ParaSet ps){
		
		return R.html("index.html");
	}
	//测试跳转freemarker
	public DataSet testFreemarker(ParaSet ps){
		Map<String,Object> data = Maps.newHashMap();
		data.put("root", "localhost:3000");
		return R.freemarker("/public/free.html",data);
	}
	
	//下载文件
	public DataSet df(ParaSet ps){
		
		return R.file(ps.getStr("path"));
	}
}
